Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update auto-join to try channel name prefixes #313

Merged
merged 2 commits into from
Jul 22, 2024
Merged

Conversation

Shadowfiend
Copy link
Contributor

In particular, this allows categorizing not just by top-level category in Discord, but also refining by a channel prefix. As an example, a channel #mezo-engineering-musd in the Mezo category would previously only auto-join the roles "Mezo Engineering mUSD" and "Mezo", because one would match the channel and one the category.

The new approach tries all prefixes of the channel name, so that "Mezo Engineering" can also be auto-tagged.

With the current Discord channel name structure, this means most items will be auto-tagged in this phase instead of by category, since project channels always prefix their project name. One key exception is Studio.

In particular, this allows categorizing not just by top-level category
in Discord, but also refining by a channel prefix. As an example,
a channel #mezo-engineering-musd in the Mezo category would previously
only auto-join the roles "Mezo Engineering mUSD" and "Mezo", because one
would match the channel and one the category.

The new approach tries all prefixes of the channel name, so that "Mezo
Engineering" can also be auto-tagged.

With the current Discord channel name structure, this means most items
will be auto-tagged in this phase instead of by category, since project
channels always prefix their project name. One key exception is Studio.
@Shadowfiend Shadowfiend requested a review from zuuring July 22, 2024 13:43
Without this, the autotagger was not tagging due to +2 entries on tags.
.reduce(
(allPrefixes, nameSegment) => [
...allPrefixes,
`${allPrefixes.at(-1) ?? []} ${nameSegment}`.trim(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added .trim() here since on local test, roles were being outputted in some cases role here, role here is, role here there, otherwise let's merge!

@zuuring zuuring merged commit 41df908 into main Jul 22, 2024
7 checks passed
@zuuring zuuring deleted the prix-fixe-threads branch July 22, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants